//
//  CZQLongBtnView.m
//  coachmanage
//
//  Created by 众拳科技 on 2018/3/15.
//  Copyright © 2018年 众拳科技. All rights reserved.
//

#import "CZQLongBtnView.h"

@implementation CZQLongBtnView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UILabel *lable = [UILabel new];
        
        lable.font = [UIFont systemFontOfSize:15];
        
        lable.backgroundColor = BackGroundColor;
        
        lable.textAlignment = NSTextAlignmentCenter;
        
        [self addSubview:lable];
        
        self.longLable = lable;
        
        UIImageView *img = [UIImageView new];
        
        img.image = [UIImage imageNamed:@"icon_eliminate"];
        
        [self addSubview:img];
        
        self.caImage = img;
        
        [self setConstraints];
        
        
    }
    return self;
}

-(void)setConstraints{
    
    [self.longLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.top.mas_equalTo(self).offset(10);
        
        make.bottom.mas_equalTo(self).offset(-10);
        
        make.right.mas_equalTo(self).offset(-15);
        
    }];
    
    [self.caImage mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self).offset(3);
        
        make.left.mas_equalTo(self.longLable.mas_right).offset(-8);
        
        make.height.width.mas_equalTo(16);
        
    }];
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
